package com.zc.finkDemo.sink;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.functions.sink.RichSinkFunction;

public class KafkaSink extends RichSinkFunction<String> {
    @Override
    public void open(Configuration parameters) throws Exception {
        System.out.println("sink建立kafka连接");
    }

    @Override
    public void close() throws Exception {
        System.out.println("sink断开kafka连接");
    }

    @Override
    public void invoke(String value, Context context) throws Exception {
        System.out.println("消息发送到自定义sink中");
    }
}
